home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 38 / giftif.zip / READGIF.C < prev    next >
C/C++ Source or Header  |  1989-11-22  |  1KB  |  44 lines

  1. /*----------------------------------------------------------------------*/
  2. /* Copyright (c) 1988-1989                        */
  3. /* by CompuServe Inc., Tucson, AZ.  All Rights Reserved            */
  4. /* READGIF.C can be copied and distributed freely for any        */
  5. /* non-commercial purposes. READGIF.C can only be incorporated        */
  6. /* into commercial software with the permission of CompuServe Inc.    */
  7. /*----------------------------------------------------------------------*/
  8.  
  9. /* READGIF.C routines to access GIF file */
  10.  
  11. /* Procedures and Variables to read page data out of GIF file */
  12.  
  13. #include        <stdio.h>
  14. #include    <string.h>
  15. #include    <dos.h>
  16.  
  17. #include    "readgif.h"
  18.  
  19. static    FILE        *gif_file; 
  20.  
  21. extern void close_stream()
  22. {
  23.    fclose( gif_file );
  24. }/*close_stream */
  25.  
  26.  
  27. extern short int    next_GIF_byte( void )
  28. {
  29.     if ( feof( gif_file ) ) return -1;
  30.     return (short int)(fgetc( gif_file ));
  31. } /* next_GIF_byte */
  32.  
  33. extern short int init_GIF_input( char    filename[21] )
  34. {
  35.    gif_file = fopen( filename, "rb");
  36.    if ( gif_file == NULL )
  37.     {
  38.     printf( "GIF file not found\n" );
  39.     return -1;
  40.     };
  41.  
  42.    return 0;
  43. } /*initialize_stream */
  44.